/* This file is part of Stimer. Stimer - Simple reminder tool.
    Copyright (C) 2012  Klimov Max <cleemmi@gmail.com>

    Stimer is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    */

#ifndef TRAYVIEW_H
#define TRAYVIEW_H

#include <QSystemTrayIcon>
#include <QMenu>
#include <QTimer>
#include <QTime>

class ReminderController;

class TrayView : public QSystemTrayIcon
{
    Q_OBJECT
public:
    TrayView(ReminderController* controller = 0, QObject *parent = 0);
    void setController(ReminderController* controller) { this->controller = controller; }
    
signals:
    void startClicked();
    void stopClicked();
    void trayClicked();

    
public slots:
    void setIconActive();
    void setIconRemind();
    void setIconDisabled();
    void start();
    void stop();
    void exit();
    void iconAction(QSystemTrayIcon::ActivationReason reason);
    void remind();
    void alert();
    void getInfo();
    void onExit();
    void onMessageClicked();

private:

    QVector<QIcon> icons;
    ReminderController *controller;

    QMenu   *contextMenu;
    QAction *astop;
    QAction *astart;
    QAction *aexit;
    QList<QAction*> ainfo;
    QTimer  *alerter;
    QTime   now;


    
};

#endif // TRAYVIEW_H
